package com.proxy.spring.demo;

import com.proxy.spring.hello.CalculateService;
import com.proxy.spring.hello.TestService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class TestController {

    @Resource
    private TestService testService;


    private CalculateService calculateService;

    @Resource
    public void setCalculateService(CalculateService calculateService) {
        this.calculateService = calculateService;
    }

    @RequestMapping("/test")
    public String getHello(@RequestBody Hello hello) {

        String testList = testService.getList("code123", "name456");
        String calculateResult = calculateService.getResult("测试");

        System.out.println(hello);
        return (testList + "," + calculateResult);
    }
}